package task.task_1;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Package: task.task_1
 * @ClassName: Dialogue
 * @Author: 862982795
 * @CreateTime: 2021/07/05 16:04
 * @Description:
 */
public class Dialogue {
    private String dialogue;

    public String getDialogue() {
        return dialogue;
    }

    public void setDialogue(String dialogue) {
        this.dialogue = dialogue;
    }

    public void print(){
        System.out.println(dialogue);
    }

    @Test
    public void test(){
        ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
        Dialogue dialogue1=(Dialogue) context.getBean("dialogue1");
        dialogue1.print();
        Dialogue dialogue2=(Dialogue) context.getBean("dialogue2");
        dialogue2.print();
    }

}
